﻿<Window x:Class="XWord.GUI.View.PreFixDemoView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d"
        xmlns:local="clr-namespace:XWord.GUI.View" Width="200"
             >
    <Grid>
        <StackPanel>
            <ListBox x:Name="a" DisplayMemberPath="Name" Height="50" ItemsSource="{Binding CategoryList,RelativeSource={RelativeSource AncestorType={x:Type local:PreFixDemoView}}}" SelectionChanged="ListBox_SelectionChanged"></ListBox>
            <Button Click="Button_Click">确定</Button>
            <TextBox TextChanged="TextBox_TextChanged"></TextBox>
            <ListBox x:Name="b" SelectionMode="Multiple" Height="300" ItemsSource="{Binding EtymaList,RelativeSource={RelativeSource AncestorType={x:Type local:PreFixDemoView}}}">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding Name}"></TextBlock>
                            <TextBlock Margin="10,0,0,0">
                           <Bold>
                            <TextBlock Foreground="Red" Text="{Binding Comment}"></TextBlock>
                        </Bold>
                        </TextBlock>
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </StackPanel>
    </Grid>
</Window>
